package org.neuedu.chapter04_0616;

public class ArrayDemo02 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 4, 65, 67, 7, 0};
        for (int i = 0; i < arr.length; i++) {
            int num = arr[i];
            System.out.println(i+","+num);
        }
        // 增强for循环
        int index = 0;
        for (int num : arr) {
            System.out.println(index+","+num);
            index++;
        }

        String[] strs = {"hello", "你好", "world", "test"};
        for (int i = 0; i < strs.length; i++) {
            String str = strs[i];
            System.out.println(str);
        }
        for (String str : strs) {
            System.out.println(str);
        }
    }
}
